package com.ld.wms.business.approve.controller;


import com.ld.wms.business.approve.service.MaterialExampleReceiveService;
import com.ld.wms.business.approve.vo.resp.MaterialExampleInventoryApproveRespVo;
import com.ld.wms.business.approve.vo.resp.MaterialExampleReceiveRespVo;
import com.ld.wms.common.ResultResponse;
import com.ld.wms.common.vo.GeneratePageListVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 待领取 前端控制器
 * </p>
 *
 * @author wangfeng
 * @since 2025-04-15
 */
@Slf4j
@Tag(name = "领用列表相关接口")
@RestController
public class MaterialExampleReceiveController {

    @Autowired
    private MaterialExampleReceiveService materialExampleReceiveService;

    @GetMapping("/api/wms/materialExampleReceive/getPageList")
    @Operation(summary = "领取列表")
    public ResultResponse<GeneratePageListVo<MaterialExampleReceiveRespVo>> getPageList(
            @Parameter(description = "(不传查询所有)状态：0未领取，1已领取，2取消领取") @RequestParam(required = false) Integer status,
            @Parameter(description = "当前页数") @RequestParam(defaultValue = "1") Integer current,
            @Parameter(description = "每页展示条数") @RequestParam(defaultValue = "10") Integer size
    ) {
        GeneratePageListVo<MaterialExampleReceiveRespVo> pageList = materialExampleReceiveService.getPageList(status, current, size);
        return ResultResponse.success(pageList);
    }

}

